Skip to contentSkip to conversation

need help about CPU offline/hotplug in Xen Unstable

DISCUSSION Ting Shen 4 participants 6 messages May 12, 2009 – May 13, 2009

lore
Share & tools
lore

Ting Shen

author
#0 lore raw

I've noticed this section in Xen 3.4 News(
http://mail-index.netbsd.org/port-xen/2009/03/02/msg004800.html):

CPU offline/hotplug: Xen 3.4 can offline

physical CPUs on CPU-core granularity.
CPU hotplugging works on CPU granularity.
It's meant as an recover-action for the case
of machine-check errors. This feature
requires Dom0 support to utilize it.
This feature has been almost tested

on Intel-CPUs only.

Then I downloaded the stable version from xen.org and installed. But since the document is not updated, I don't know the detail method to offline a physical CPU.

Can anyone give me the hint? Thanks very much!

Signature · 2 lines
Yours Sincerely,
Ting Shen

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#1 lore raw
Quoted 4 lines · Ting Shen

Then I downloaded the stable version from xen.org <http://xen.org> and installed.
But since the document is not updated, I don't know the detail method to offline a physical CPU.

It's available as a library function (xc_cpu_offline) but not actually plumbed into a xm command, or other tool.

-- Keir

#2 lore raw

We have a tools to achieve that (i.e. xm command). But as Xen tree is closed now, so we are waiting for it be open again and will send it out.

--jyh

Quoted 17 lines · [email protected] wrote:
Quoted 3 lines · Ting Shen

Then I downloaded the stable version from xen.org <http://xen.org>
and installed. But since the document is not updated, I don't know the detail method to offline a physical CPU.

It's available as a library function (xc_cpu_offline) but not actually plumbed into a xm command, or other tool.

-- Keir

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#3 lore raw
In reply to Keir Fraser

Thanks a lot.
Is there a sample or tutorial for how to implement the offline process using this library?

Quoted 14 lines · Keir Fraser
Quoted 7 lines · On 12/05/2009 15:47, "Ting Shen" [email protected]> wrote:

Then I downloaded the stable version from xen.org http://xen.org> and

installed.

But since the document is not updated, I don't know the detail method to

offline a physical CPU.

Quoted 7 lines

It's available as a library function (xc_cpu_offline) but not actually

plumbed into a xm command, or other tool.

-- Keir

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#4 lore raw

please try below test code piece. Hope it could help you.

Thanks& Regards,
Criping

#include <stdio.h>
#include <stdlib.h>

#include <xenctrl.h>

int main(int argc, char *argv[] )

{
    int cpu, xc_id;
    if ( argc < 2) {
        printf("Please input offline CPU-id\n");
        exit(0);
    }
    cpu = atoi(argv[1]);
    printf("Offline CPU %d\n", cpu);
    xc_id = xc_interface_open();
    xc_cpu_offline(xc_id, cpu);
    printf("CPU offlined\n");
    xc_interface_close(xc_id);
    return 0;
}

________________________________
From: [email protected] [mailto:[email protected]] On Behalf Of [email protected]
Sent: 2009年5月13日 12:30
To: Xen-devel
Subject: Re: Re: [Xen-devel] need help about CPU offline/hotplug in Xen Unstable

Thanks a lot.
Is there a sample or tutorial for how to implement the offline process using this library?

Quoted 14 lines · Keir Fraser
Quoted 7 lines · On 12/05/2009 15:47, "Ting Shen" [email protected]> wrote:

Then I downloaded the stable version from xen.org http://xen.org> and

installed.

But since the document is not updated, I don't know the detail method to

offline a physical CPU.

Quoted 12 lines

It's available as a library function (xc_cpu_offline) but not actually

plumbed into a xm command, or other tool.

-- Keir

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

author
#5 lore raw

Yes, It works well. Thank you very much indeed!

2009/5/13 Ke, Liping <[email protected]>

Quoted 68 lines

please try below test code piece. Hope it could help you.

Thanks& Regards,
Criping

#include <stdio.h>
#include <stdlib.h>

#include <xenctrl.h>

int main(int argc, char *argv[] )

{
    int cpu, xc_id;
    if ( argc < 2) {
        printf("Please input offline CPU-id\n");
        exit(0);
    }
    cpu = atoi(argv[1]);
    printf("Offline CPU %d\n", cpu);
    xc_id = xc_interface_open();
    xc_cpu_offline(xc_id, cpu);
    printf("CPU offlined\n");
    xc_interface_close(xc_id);
    return 0;
}

------------------------------
*From:* [email protected] [mailto:
[email protected]] *On Behalf Of * [email protected]
*Sent:* 2009年5月13日 12:30
*To:* Xen-devel
*Subject:* Re: Re: [Xen-devel] need help about CPU offline/hotplug in Xen Unstable

Thanks a lot.
Is there a sample or tutorial for how to implement the offline process using this library?

Quoted 9 lines · Keir Fraser
Quoted 5 lines · On 12/05/2009 15:47, "Ting Shen" [email protected]> wrote:

Then I downloaded the stable version from xen.org http://xen.org> and

installed.

But since the document is not updated, I don't know the detail method

to

Quoted 17 lines
Quoted 2 lines

offline a physical CPU.

It's available as a library function (xc_cpu_offline) but not actually

plumbed into a xm command, or other tool.

-- Keir

Signature · 2 lines
Yours Sincerely,
Ting Shen

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel